This application is based on application No. H10-030963 filed in Japan, the content of which is hereby incorporated by reference.
1. Field of the Invention
The present invention relates to an image decoding apparatus, and more specifically relates to a technique for improving the utilization ratio of a memory.
2. Description of the Background Art
MPEG2 (Moving Pictures Experts Group2) standard is highly regarded by technicians all over the world as the international standard technique for compressing moving pictures. In particular, when encoded according to an intra-frame bidirectionally predictive method, moving pictures are compressed at a. very high ratio using interrelations between a picture and its previously and subsequently displayed pictures. This method is of particular value when recording moving pictures onto a removable storage medium or transmitting moving pictures to a remote destination via a communication medium.
While moving pictures are compressed at a high ratio with this method, there is apprehension among technicians that image decoding apparatuses may increase in complexity and scale. This is because when decoding picture data that is encoded according to the intra-frame bidirectionally predictive method (such picture data being ordinarily referred to as xe2x80x9cB-pictures (Bidirectionally Predictive pictures)xe2x80x9d), an image decoding apparatus needs to refer to previously and subsequently displayed pictures. This means that the frame memories of the image decoding apparatus need to store both previously displayed pictures and subsequently displayed pictures that are referred to by B-pictures. As a result, the scale of the frame memories is increased. Each frame memory is a memory area for storing pixel data that is displayed on a screen for one frame. Pixel data stored in the frame memory is read and is converted into image signals in line units (720 horizontal pixels by one vertical pixel, for instance) in synchronization with a horizontal synch signal of the display.
FIG. 1A shows an example of an SD-RAM (Synchronous Dynamic RAM) where three frame memories are reserved. This example is based on the assumption that the SD-RAM is two banks by 2048 rows by 256 columns in size. There are pictures of three picture types, which is to say the aforementioned B-pictures, Intra pictures (I-pictures), and Predictive pictures (P-pictures). I-pictures are encoded according to an intra-frame encoding method and B-pictures are encoded according to an intra-frame forward direction predictive encoding method. The SD-RAM shown in FIG. 1A includes three frame memories which store decoded pictures according to the picture types.
More specifically, in this drawing, the non-reference picture data frame memory stores a decoded B-picture; the reference picture data A frame memory stores a decoded I-picture or a decoded P-picture; and the reference picture data B frame memory stores a decoded I-picture or a decoded P-picture. Each frame memory occupies an area which is two banks by 608 rows by 256 columns in size in the SD-RAM. Decoded picture data stored in the reference picture data A frame memory and the reference picture data B frame memory is referred to while a B-picture is decoded.
A large area in the SD-RAM is allocated to these frame memories under the stated conventional technique. Therefore, there is a problem that the SD-RAM cannot provide work areas aside from the frame memories. Work areas are used for several purposes, such as for storing on-screen display (OSD) data. The word xe2x80x9cOSDxe2x80x9d refers to character fonts and computer graphics overlaid on moving pictures. The OSD data is used to display the operation states of an image decoding apparatus, such as xe2x80x9cplayxe2x80x9d, xe2x80x9cstopxe2x80x9d, and xe2x80x9crecordxe2x80x9d, on a screen. The OSD data is also used to display a menu for allowing an operator to input desired instructions.
When the SD-RAM does not include enough space for storing OSD data, an additional memory needs to be used to provide an OSD data storage area for storing the OSD data. When such an additional memory cannot be used, a memory mapping method may be used to provide the OSD data storage area, as shown in FIG. 1B. In FIG. 1A, the non-reference picture data frame memory occupies a memory area which is 2 banks by 608 rows by 256 columns in size. On the other hand, in FIG. 1B, the memory area assigned to the non-reference picture data frame memory is reduced to the size of 2 banks by 507 rows by 256 columns. As a result, a free area which is 2 banks by 101 rows by 256 columns in size is obtained and the free area is used as the OSD data storage area.
This technique where the data size of B-pictures is reduced is based on the characteristic that B-pictures are not referred to by other pictures. While degradation in the picture quality of an I-picture or P-picture stored in the frame memories may adversely affect the picture quality of other pictures that refer to the I-picture or P-picture, a B-picture stored in a frame memory is not referred to by other pictures. Therefore, the degradation in the picture quality of B-pictures does not adversely affect the picture quality of other pictures. As a result, a reduction in the size of the frame memory area for storing picture data of a B-picture is admissible, unlike the cases of an I-picture or a P-picture. Accordingly, the frame memory for storing picture data of B-pictures is made smaller than the frame memories for storing picture data of I-pictures and P-pictures.
To reduce the size of picture data of B-pictures, the chrominance data of B-pictures is generated at an interval (is subsampled). This method is based on the human eye""s sensitivity to small changes in brightness and relative insensitivity to small changes in color.
However, subsampling of the chrominance data of B-pictures accentuates the differences in picture quality between the display of I-pictures and P-pictures and the display of B-pictures. That is, picture quality is not degraded when I-pictures and P-pictures are displayed, but picture quality is degraded when B-pictures are displayed. Therefore, when moving pictures are replayed, pictures of degraded picture quality and pictures of non-degraded picture quality are alternately displayed on the screen. Furthermore, when recording moving pictures onto a removable storage medium or transmitting moving pictures to a remote destination via a communication medium, the moving pictures need to be compressed at a high ratio. Therefore, many frames are encoded as B-pictures and few frames are encoded as I-pictures and P-pictures. Accordingly, when the picture quality of the frequently occurring B-pictures is degraded, an operator may have the impression that the picture quality of the moving pictures as a whole is poor.
A playback apparatus ordinarily requires an OSD data storage area when an OSD needs to be displayed according to the instruction input by an operator. Since an OSD is displayed according to an operator""s instruction, the OSD data storage area only needs to be reserved when OSD data is displayed. However, a work area is always reserved under the stated conventional technique, which causes a problem that the picture quality of B-pictures is sacrificed unnecessarily.
The object of the present invention is to provide an image decoding apparatus which reserves a work area for storing various data, such as OSD data, without sacrificing picture quality.
To achieve the state object, the image decoding apparatus of the present invention decodes pieces of picture data included in a video stream according to an instruction from a host apparatus and writes the decoded pieces of picture data into a storage apparatus, where each piece of picture data is of one of a plurality of picture types which are each related to one of different encoding methods, and the storage apparatus includes a plurality of frame areas for storing most recently decoded pieces of picture data separately according to the plurality of picture types, where the image decoding apparatus includes: a decoding unit for decoding pieces of picture data included in the video stream one at a time while referring to decoded picture data in at least one of the plurality of frame areas; a writing unit for writing a newly decoded piece of picture data over a piece of picture data in one of the plurality of frame areas; and an area allocation unit for allocating, on receiving a reservation request to reserve a work area in the storage apparatus from the host apparatus, a region in one of the plurality of frame areas as the work area, where the region should store (1) a certain part of a piece of picture data of a predetermined picture type that is yet to be decoded by the decoding unit, or (2) a certain part of a decoded piece of picture data of the predetermined picture type that is yet to be written by the writing unit.
With the stated construction, only when the host apparatus issues the reservation request for reserving a work area, the image decoding apparatus discards a certain part of picture data and reserves the work area in a region of the frame memory that was assigned to store the discarded part of picture data. Therefore, even if the certain part of picture data is lost, the picture quality of picture data is not degraded as a whole. As a result, the host apparatus performs additional functions without using an additional memory.
When a certain part of picture data that is yet to be decoded is discarded to reserve a work area, unnecessary decode processing is omitted. As a result, decode processing is performed at high speed and the amount of consumption of electricity is reduced.
Here, the host apparatus may output the reservation request and host data to be written into the storage apparatus to the image decoding apparatus, each piece of picture data may include a plurality of pieces of pixel data for one frame, and the area allocation unit may include: an area storage unit for storing area location information showing a location of a predetermined area on a screen; a prohibition unit for prohibiting decoding of pixel data that corresponds to the predetermined area, the corresponding pixel data being included in picture data of the predetermined type; and a first writing unit for writing the host data into the allocated region.
Here, the host apparatus may continuously output the reservation request for a predetermined period, and the prohibition unit may continuously prohibit the decoding of the corresponding pixel data for the predetermined period.
Here, the area storage unit may store the area location information showing an outer area of the screen.
With the stated constructions, the predetermined area corresponds to the outer area of picture data. In many cases, the outer area is not displayed on a screen. Therefore, even if a certain part of picture data corresponding to the outer area is discarded, an operator is not disturbed by the discarded picture data.
Here, the host apparatus may start to output the reservation request when on-screen display data is to be written into the work area, the host apparatus may output the on-screen display data as the host data with the reservation request, and the area storage unit may store the area location information showing an area of the screen where the on-screen display data is displayed.
With the stated construction, the predetermined area corresponds to a picture area onto which an OSD is overlaid. Such a picture area is not displayed on a screen. Therefore, even if picture data in the picture area is discarded, an operator is not disturbed by the discarded picture data.